package InternetHax;

import javax.microedition.lcdui.Canvas;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import javax.microedition.lcdui.Graphics;

/**
 *
 * @author alanclelland
 */
public class exampleFontCanvas extends Canvas {

    Font59 bigFont;
    Font59 smallFont;
    int redFont;
    int gradientFont;
    int smallTransparent;

    public exampleFontCanvas() {
        bigFont = new Font59("/Terminal.fnt");
        smallFont = new Font59("/Terminal.fnt");
        redFont = bigFont.makeNewFont(0xffff0000);
        gradientFont = bigFont.makeGradientFont(0x00ffff00, 0xff00ffff);
        smallTransparent = smallFont.makeNewFont(0x55ffffff);
    }

    public void paint(Graphics g) {
        g.setColor(0x00000000);
        g.fillRect(0, 0, getWidth(), getHeight());
        int yStart = 10;
        bigFont.PrintString(g, getWidth() / 2, yStart, "You were eaten by a grue!", Font59.HCENTER, Font59.TOP);
        yStart += bigFont.GetFontHeight();
        bigFont.PrintString(g, getWidth() / 2, yStart, "Red Text", Font59.HCENTER, Font59.TOP, redFont);
        yStart += bigFont.GetFontHeight();
        bigFont.PrintString(g, getWidth() / 2, yStart, "Gradiented", Font59.HCENTER, Font59.TOP, gradientFont);
        yStart += bigFont.GetFontHeight();

        g.setColor(0x00660000);
        g.fillRect(0, yStart, getWidth() / 2, smallFont.GetFontHeight() * 2);
        smallFont.PrintString(g, getWidth() / 2, yStart, "Solid colour fonts can also be semi transparent", Font59.HCENTER, 0);
        yStart += smallFont.GetFontHeight();
        smallFont.PrintString(g, getWidth() / 2, yStart, "Solid colour fonts can also be semi transparent", Font59.HCENTER, 0, smallTransparent);
    }
}
